package usbcali.edu.co.pqrs.presentation.backingBeans;

import java.io.Serializable;
import java.util.List;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.ViewScoped;

import usbcali.edu.co.pqrs.exceptions.ZMessManager;
import usbcali.edu.co.pqrs.modelo.dto.UsuariosInternosDTO;
import usbcali.edu.co.pqrs.presentation.businessDelegate.IBusinessDelegatorView;
import usbcali.edu.co.pqrs.utilities.FacesUtils;

@ManagedBean
@ViewScoped
public class MenuTemplateView implements Serializable {

	public IBusinessDelegatorView getBusinessDelegatorView() {
		return businessDelegatorView;
	}

	public void setBusinessDelegatorView(
			IBusinessDelegatorView businessDelegatorView) {
		this.businessDelegatorView = businessDelegatorView;
	}

	private static final long serialVersionUID = 1L;

	private boolean menuItemAnexosPqr;

	private List<UsuariosInternosDTO> data;
	@ManagedProperty(value = "#{BusinessDelegatorView}")
	private IBusinessDelegatorView businessDelegatorView;

	// public void prueba() throws ZMessManager, Exception{
	// setData(businessDelegatorView.consultarRol(FacesUtils.login()));
	// }
	//
	public boolean prueba2() throws ZMessManager, Exception {

		return menuItemAnexosPqr = businessDelegatorView.buscarRolUsuario(
				FacesUtils.login(), 1L);

	}

	public boolean isMenuItemAnexosPqr() {
		return menuItemAnexosPqr;
	}

	public void setMenuItemAnexosPqr(boolean menuItemAnexosPqr) {
		// try {
		// menuItemAnexosPqr=
		// businessDelegatorView.buscarRolUsuario(FacesUtils.login(), 14L);
		// System.out.println("mmmmmmmmmmmmmmm");
		// } catch (Exception e) {
		// // TODO: handle exception
		// }
		//
		this.menuItemAnexosPqr = menuItemAnexosPqr;
	}

	public List<UsuariosInternosDTO> getData() {
		return data;
	}

	public void setData(List<UsuariosInternosDTO> data) {
		this.data = data;
	}

}
